c# ienumerable to list

42

convert ienumerable to list -

using Linq;

IEnumerable<int> enumerable = Enumerable.Range(1, 300);
List<int> asList = enumerable.ToList();

list to ienumerable c# -

//convert list to ienumerable c#
List<Book> list = new List<Book>();
return list.AsEnumerable();

c# ienumerable to list -

List<object> list = enumerable.ToList();

Comments

Submit
0 Comments